#ifndef _OBJ_MANAGER_H_
#define _OBJ_MANAGER_H_

#include <map>
#include <list>
#include "aobject.hpp"
#include "fact.hpp"

class						ObjManager
{
public:
  enum						operators
    {
      AND,
      OR,
      NOT,
      XOR,
      EQUAL,
      UNDEFINED
    };
private:
  std::map<std::string, AObject*>		_facts;
  std::map<unsigned int, std::list<AObject*> >	_lineObjs;
  std::map<char, operators>			_opType;
public:
  ObjManager();
  static void					displayThis(AObject* obj);
  bool						linkObjs();
  bool						linkLine(AObject::LinkChain);
  void						addObj(unsigned int line, AObject*);
  AObject*					getFact(const std::string&);
  AObject*					createOperator(operators);
  bool						createFact(const std::string& name);
  operators					isOp(char) const;
  void						displayObjs();

  virtual ~ObjManager() {};
};

#endif /* _OBJ_MANAGER_H_ */
